package com.edar.dto.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.edar.components.AccountBean;
import com.edar.dto.AbstractDTO;
import com.edar.dto.AccountDTO;
import com.edar.model.Account;
@Service("accountDto")
public class AccountDTOImpl extends AbstractDTO implements AccountDTO {

	public AccountBean trans(final Account pAccount) {
		return (AccountBean) getDozer().map(pAccount, AccountBean.class);
	}

	public List<AccountBean> trans(final List<?> pos) {
		List<AccountBean> list = new ArrayList<AccountBean>();
		for (Object object : pos) {
			if(object instanceof Account){
				list.add(trans((Account)object));
			}
		}
		return list;
	}
	private transient List<AccountBean> list;
	public List<AccountBean> getList() {
		return list;
	}
}
